<template>
    <el-form :model="orderinfo" label-width="80px" style="padding: 10px; color: #000">
        <el-form-item label="领/退料人">
            <el-tag>姓名</el-tag> <span>{{orderinfo.name}}</span>
            <el-tag>部门</el-tag> <span>{{orderinfo.departmentname}}</span>
        </el-form-item>
        <el-form-item label="产品列表">
            <el-table :data="orderlist" :stripe="true" height="500" show-summary>
                <el-table-column prop="id" label="ID" width="80"></el-table-column>
                <el-table-column prop="goodsname" label="商品名称"></el-table-column>
                <el-table-column prop="num" label="数量" width="100"></el-table-column>
                <el-table-column label="操作" width="150"></el-table-column>
            </el-table>
        </el-form-item>
        <el-form-item label="描述">
            <el-input type="textarea" v-model="orderinfo.remarks" disabled></el-input>
        </el-form-item>
        <el-form-item>
            <el-button type="primary" size="mini" icon="upload2" @click="onSubmit" v-show="orderinfo.status == 0">确定审核</el-button>
            <el-button type="danger" size="mini" icon="close" @click="closewin">取消关闭</el-button>
        </el-form-item>
    </el-form>
</template>
<script>
import C from '#/src/common/common.js'

export default {
    name: 'pickOrderInfo',
    data() {
        return {
            orderinfo: {},
            orderlist: [],
            stut: C.getDatas().st
        }
    },
    methods: {
        onSubmit: async function() {
            let data = await C.ajax('/shop/stock/reviewstockorder', { id: C.getDatas().id }, 'post')
            if (data) C.closeBrowserWindow(data)
        },
        closewin: function() {
            C.closewin()
        }
    },
    mounted: async function() {
        let data = await C.ajax('/shop/stock/pickorderinfo', { id: C.getDatas().id }, 'post')
        if (data) {
            this.orderinfo = data.orderinfo
            this.orderlist = data.orderlist
        }
    }
}
</script>